home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / mcga#01.zip / TEST01.PAS < prev   
Pascal/Delphi Source File  |  1992-06-11  |  979b  |  64 lines

  1. Program MCGATest;
  2.  
  3. uses
  4.   Crt,Dos,MCGA01;
  5.  
  6. var
  7.   Stop,
  8.   Start  :  LongInt;
  9.   Regs   :  Registers;
  10.  
  11. Function Tick : LongInt;
  12. begin
  13.   Regs.ah := 0;
  14.   Intr ($1A,regs);
  15.   Tick := Regs.cx shl 16 + Regs.dx;
  16. end;
  17.  
  18. Procedure Pause;
  19. begin
  20.   Repeat Until Keypressed;
  21.   While Keypressed do While Readkey = #0 do;
  22. end;
  23.  
  24. Procedure ShowAndTell;
  25. begin
  26.   Pause;
  27.   TextMode (3);
  28.   Write   ('Routine took ',(Stop-Start),' ticks or ');
  29.   WriteLn ((Stop-Start)/18.2:4:3,' seconds!');
  30.   Pause;
  31. end;
  32.  
  33. Procedure Control;
  34. var
  35.   I,J :  Integer;
  36. begin
  37.   SetGraphMode ($13);
  38.  
  39.   Start := Tick;
  40.   For I := 0 to 199 do
  41.     For J := 0 to 320 do
  42.       SetPixelPas (J,I,Random(256));
  43.   Stop := Tick;
  44.   ShowAndTell;
  45.  
  46.   SetGraphMode ($13);
  47.  
  48.   Start := Tick;
  49.   For I := 0 to 199 do
  50.     For J := 0 to 320 do
  51.       SetPixelAsm (J,I,Random(256));
  52.   Stop := Tick;
  53.   ShowAndTell;
  54. end;
  55.  
  56. Procedure Init;
  57. begin
  58.   Randomize;
  59. end;
  60.  
  61. Begin
  62.   Init;
  63.   Control;
  64. End.